package com.moneytalks.blazepoc.services.responders {
	import com.moneytalks.blazepoc.models.NotesViewer;
	
	import mx.collections.ArrayCollection;
	import mx.messaging.messages.RemotingMessage;
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.events.ResultEvent;

	public class RetrieveNotesResponder implements IResponder {
		private var _model:NotesViewer;
		
		public function RetrieveNotesResponder(m:NotesViewer=null) {
			_model = m;
		}

		public function result(data:Object):void {
			var e:ResultEvent = data as ResultEvent;
			var notes:ArrayCollection = ArrayCollection(e.result);
			_model.allNotes = notes;
		}
		public function fault(info:Object):void {
			throw new Error("Error in response:" + info);
		}
	}
}